<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num = prompt('请您从1~7输入一个值：');
        switch (parseInt(num)) {
            case 1:
                alert('今天星期一');
                break;
            case 2: alert('今天星期二');
                break;
            case 3: alert('今天星期三');
                break;
            case 4: alert('今天星期四');
                break;
            case 5: alert('今天星期五');
                break;
            case 6: alert('今天星期六');
                break;
            case 7: alert('今天星期七');
                break;
            default:
                alert('按要求输入哦！');
        }
    </script>
</head>

<body>

</body>

</html>